package responsibilitychain.source;

/**
 * @author Chen Guang
 * @date 2019/4/23 0023 上午 9:44
 */
public class ConcreteHandlerA implements Handler{

    private Handler successor;

    @Override
    public void setSuccessor(Handler successor) {
        this.successor = successor;
    }

    @Override
    public void handleRequest(int request) {
        if(request > 0 && request <= 10){
            System.out.println(this.getClass().getName()+ "处理请求 " + request);
        }else if(successor != null){
            //交给下一个节点
            successor.handleRequest(request);
        }
    }
}
